﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.NET.Core;
/// <summary>
/// 车辆求购信息表
/// </summary>
[SugarTable(null, "车辆求购信息表")]
[SugarIndex("index_{table}_B", nameof(BuyerId), OrderByType.Asc)]
public partial class AppVehiclePurchase : EntityTenant
{
    /// <summary>
    /// 买家Id
    /// </summary>
    [SugarColumn(ColumnDescription = "买家Id")]
    public long BuyerId { get; set; }

    /// <summary>
    /// 上牌地区Id(市级)
    /// </summary>
    [SugarColumn(ColumnDescription = "上牌地区Id")]
    public string RegionId { get; set; }

    /// <summary>
    /// 车源地地区Id(市级)
    /// </summary>
    [SugarColumn(ColumnDescription = "车源地地区Id(市级)")]
    public string SourceRegionId { get; set; }

    /// <summary>
    /// 类型
    /// </summary>
    [SugarColumn(ColumnDescription = "类型", Length = 50)]
    [MaxLength(50)]
    public VehicleTypeEnum Type { get; set; }

    /// <summary>
    /// 期望品牌
    /// </summary>
    [SugarColumn(ColumnDescription = "期望品牌", Length = 50)]
    [MaxLength(50)]
    public long? BrandId { get; set; }

    /// <summary>
    /// 期望车型
    /// </summary>
    [SugarColumn(ColumnDescription = "期望车型", Length = 100)]
    [MaxLength(100)]
    public long? ModelId { get; set; }

    /// <summary>
    /// 外观颜色
    /// </summary>
    [SugarColumn(ColumnDescription = "外观颜色")]
    public ColorEnum ExteriorColor { get; set; }

    /// <summary>
    /// 内饰颜色
    /// </summary>
    [SugarColumn(ColumnDescription = "内饰颜色")]
    public ColorEnum InteriorColor { get; set; }

    /// <summary>
    /// 选装配置
    /// </summary>
    [SugarColumn(ColumnDescription = "选装配置", Length = 128)]
    public string OptionalConfigs { get; set; }

    /// <summary>
    /// 全款预算（万元）
    /// </summary>
    [SugarColumn(ColumnDescription = "全款预算（万元）", DecimalDigits = 2)]
    public decimal? FullPaymentBudget { get; set; }

    /// <summary>
    /// 分期首付（万元）
    /// </summary>
    [SugarColumn(ColumnDescription = "分期首付（万元）", DecimalDigits = 2)]
    public decimal? InstallmentDownPayment { get; set; }

    /// <summary>
    /// 月供预算（元）
    /// </summary>
    [SugarColumn(ColumnDescription = "月供预算（元）", DecimalDigits = 2)]
    public decimal? MonthlyPayment { get; set; }

    /// <summary>
    /// 是否接受旧车置换（0-否 1-是）
    /// </summary>
    [SugarColumn(ColumnDescription = "是否接受旧车置换")]
    public bool AcceptTradeIn { get; set; }

    /// <summary>
    /// 车况要求（1-准新车 2-精品车 3-一般车况 4-事故车）
    /// </summary>
    [SugarColumn(ColumnDescription = "车况要求")]
    public VehicleConditionEnum ConditionRequirement { get; set; }

    /// <summary>
    /// 期望上牌年份（开始）
    /// </summary>
    [SugarColumn(ColumnDescription = "期望上牌年份（开始）")]
    public int? RegisterYearFrom { get; set; }

    /// <summary>
    /// 期望上牌年份（结束）
    /// </summary>
    [SugarColumn(ColumnDescription = "期望上牌年份（结束）")]
    public int? RegisterYearTo { get; set; }

    /// <summary>
    /// 最低预算(元)
    /// </summary>
    [SugarColumn(ColumnDescription = "最低预算", ColumnDataType = "decimal(18,2)")]
    public decimal? BudgetMin { get; set; }

    /// <summary>
    /// 最高预算(元)
    /// </summary>
    [SugarColumn(ColumnDescription = "最高预算", ColumnDataType = "decimal(18,2)")]
    public decimal? BudgetMax { get; set; }

    /// <summary>
    /// 期望里程数（万公里）
    /// </summary>
    [SugarColumn(ColumnDescription = "期望里程数（万公里）", DecimalDigits = 1)]
    public decimal? ExpectedMileage { get; set; }


    /// <summary>
    /// 补充要求
    /// </summary>
    [SugarColumn(ColumnDescription = "补充要求", Length = 500)]
    public string? AdditionalRequirements { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", Length = 128)]
    [MaxLength(128)]
    public string? Remark { get; set; }

    /// <summary>
    /// 状态(1-求购中 2-已购得 3-已取消)
    /// </summary>
    [SugarColumn(ColumnDescription = "状态")]
    public PurchaseStatusEnum Status { get; set; } = (PurchaseStatusEnum)1;

    /// <summary>
    /// 关联买家
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(BuyerId))]
    public SysUser Buyer { get; set; }
}